let mongoose = require('mongoose');

var Scheme = mongoose.Schema;
//创建学生的scheme对象
let stuScheme = new Scheme({
  name:String,
  age:Number,
  gender: {
    type:String,
    default:'female'
  },
  address:String
});

//创建model 只有通过model才能操作文档
//参数一：数据库中集合名称
//参数二：对应的学生scheme
let StuModel = mongoose.model('student',stuScheme);

exports.StuModel = StuModel